<?php defined('SYSPATH') or die('No direct access allowed.');

	class Model_FileSignalReader extends Model{
		
		protected $segment;
		
		public function getSegment(){
			return $this->segment;
		}
		
		public function read($filepath){
			$i = 0;
			$samples = array();
			
			//Lo ideal seria ir validando los valores que se leen...feature para mas adelante
			$fp = fopen($filepath,"r");
			while(!feof($fp)){	$samples[$i++] = fgets($fp);}
			fclose($fp);
	
			$this->segment = Model::factory("segment");
			$this->segment->samples = $samples;		
		}
			
		
		
		public function write($filename,$segment){
			
		}
		
	}
?>
